# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kcalutils
pkgver=20.04.3
pkgrel=0
pkgdesc="The KDE calendar utility library"
arch="all !armhf"
url="https://api.kde.org/kdepim/kcalutils/html"
license="LGPL-2.0-or-later"
depends_dev="kcoreaddons-dev kconfig-dev ki18n-dev kcodecs-dev kwidgetsaddons-dev kconfigwidgets-dev kiconthemes-dev grantlee-dev kcalendarcore-dev kidentitymanagement-dev"
makedepends="$depends_dev extra-cmake-modules"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/release-service/$pkgver/src/kcalutils-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build

	# kcalutils-testincidenceformatter is broken
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -E "kcalutils-testincidenceformatter"
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}
sha512sums="9c51af22da7a0a4ad62449c28386b016fc1836f6be0735acd7756f4a57e72df747160c0da56c2803c204b5dc7be9396e8b23fc9b26692943ebbf6eaf5dea9e6d  kcalutils-20.04.3.tar.xz"
